﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OrderDetail.aspx.cs" Inherits="Admin_shop_OrderDetail" %>

<%@ Register Src="~/Admin/Banner.ascx" TagName="TogoBanner" TagPrefix="uc1" %>
<%@ Register Src="~/Admin/Foot.ascx" TagName="Foot" TagPrefix="uc2" %>
<%@ Register TagPrefix="epc" Namespace="Hangjing.Control" Assembly="Hangjing.Control" %>
<%@ Register Src="~/Admin/Adleft.ascx" TagName="togoleft" TagPrefix="uc4" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>订单信息管理-<%= WebUtility.GetMyName()%></title>
    <link href="../css/reset.css" rel="stylesheet" type="text/css" />
    <link href="../css/menu.css" rel="stylesheet" type="text/css" />
    <link href="../css/boxes.css" rel="stylesheet" type="text/css" />
    <link href="../css/Validator.css" rel="stylesheet" type="text/css" />
    <link href="../css/divDialog.css" rel="stylesheet" type="text/css" />
    <link href="../css/Common.css" rel="stylesheet" type="text/css" />
    <link href="../css/building.css" rel="stylesheet" type="text/css" />
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="../css/iestyles.css" media="all" />
    <![endif]-->
    <!--[if lt IE 7]>
    <link rel="stylesheet" type="text/css" href="../css/below_ie7.css" media="all" />
    <![endif]-->
    <!--[if IE 7]>
    <link rel="stylesheet" type="text/css" href="../css/ie7.css" media="all" />
    <![endif]-->


    <script type="text/javascript" src="../javascript/DatePicker/WdatePicker.js"></script>


    <script src="../javascript/jquery-1.7.min.js"></script>




    <script src="../javascript/Common.js?v=0114" type="text/javascript"></script>
    <script src="../javascript/ShowDivDialog.js" type="text/javascript"></script>
    <script src="../javascript/easyajaxcore.js" type="text/javascript"></script>
    <script src="../../javascript/eventwrapper.min.js"></script>
    <script src="../javascript/order.js" type="text/javascript"></script>
    <script src="../../javascript/spin.min.js"></script>
<script src="../../javascript/sendfee.js?v=2017030202"></script>

    <script src="/Admin/javascript/jquery.PrintArea.js" type="text/javascript"></script>


    <script language="javascript" type="text/javascript">

        $(window).load(function () {
            $("#loading-mask").hide(); showContent(2);
        });

        function init() {

        }
        function reset() {
            $("#tbName").html();
            $("#tbLinkUrl").html();
            $("#tbOrder").html();
        }
        function SetTimeS(value) {
            $("#tbTime1Start").val(value);
        }

        function SetTimeE(value) {
            $("#tbTime1End").val(value);
        }

    </script>

</head>
<body>
    <form id="form1" runat="server">
        <!--加载中显示的div-->
        <div id="loading-mask">
            <p class="loader" id="loading_mask_loader">
                <img src="../images/ajax-loader-tr.gif" alt="加载中..." /><br />
                请等待...
            </p>
        </div>


        <epc:Hint ID="Hint1" runat="server" HintImageUrl="../images/Control" />
        <asp:HiddenField runat="server" ID="hflocalinfo" />
        <asp:HiddenField runat="server" ID="hidLat" />
        <asp:HiddenField runat="server" ID="hidLng" />

        <asp:HiddenField runat="server" ID="hfshoplat" />
        <asp:HiddenField runat="server" ID="hfshoplng" />
        <asp:HiddenField runat="server" ID="hftid" />

        <asp:HiddenField runat="server" ID="hfadminname" />


        <div class="wrapper">
            <!--banner start-->
            <uc1:TogoBanner runat="server" ID="Banner" />
            <!--banner end-->
            <!--center start-->
            <div class="middle" id="anchor-content">
                <div id="page:main-container">
                    <div class="columns ">
                        <div class="side-col" id="page:left">
                            <uc4:togoleft ID="togoleft1" runat="server" />
                        </div>
                        <div class="main-col" id="content">
                            <div class="main-col-inner">
                                <div id="divMessages">
                                </div>
                                <div style="visibility: visible;" class="content-header">
                                    <h3 class="icon-head head-customer">
                                        <asp:Label runat="server" ID="pageType"></asp:Label></h3>
                                    <div style="width: 0px; height: 17px;" class="content-buttons-placeholder">
                                        <p style="" class="content-buttons form-buttons">
                                            <asp:Button ID="Button2" runat="server" CssClass="button_1" OnClientClick="history.go(-1);return false;"
                                                Text="返回"></asp:Button>


                                            <asp:Button ID="btSave" runat="server" CssClass="button_1" OnClick="btSave_Click"
                                                Text="保存"></asp:Button>



                                            <asp:Button ID="Button7" runat="server" CssClass="button_1" OnClientClick="printorder();return false;"
                                                Text="小票打印"></asp:Button>

                                            <a href="/images/printset.jpg" target="_blank">打印设置</a>

                                        </p>
                                    </div>
                                </div>
                                <style type="text/css">
                                    .form-list td.label {
                                        width: 80px;
                                    }
                                </style>
                                <div id="order-addresses">
                                    <asp:ScriptManager ID="ScriptManager1" runat="server">
                                    </asp:ScriptManager>
                                    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                                        <ContentTemplate>
                                            <div class="">

                                                <div class="box-left">
                                                    <%----%>
                                                    <div class="entry-edit">
                                                        <div class="entry-edit-head">
                                                            <h4 class="icon-head head-billing-address">订单基本信息</h4>
                                                        </div>
                                                        <fieldset class="np">
                                                            <div class="order-address" id="order-billing_address_fields">
                                                                <div class="content">
                                                                    <div class="hor-scroll">
                                                                        <fieldset>
                                                                            <legend runat="server" id="lbstatus">订单操作</legend>
                                                                            <table class="form-list" cellspacing="0">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td class="label" style="width: 80px;">状态操作
                                                                                        </td>
                                                                                        <td class="value" style="width: 500px;">

                                                                                            <asp:Button ID="Button4" CommandArgument="2" runat="server" CssClass="button_1" OnClick="updatestate_Click"
                                                                                                Text="审核通过"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                                                                            <asp:Button ID="Button5" CommandArgument="3" runat="server" CssClass="button_1" OnClick="updatestate_Click"
                                                                                                Text="完成"></asp:Button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

                                                                                            <asp:Button ID="Button6" CommandArgument="6" runat="server" CssClass="button_1" OnClick="updatestate_Click"
                                                                                                Text="取消"></asp:Button>

                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                配送状态<span class="required"></span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" Enabled="false" ID="tbsendstate" CanBeNull="必填" Width="80px"
                                                                                                class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                商户接收<span class="required"></span></label>
                                                                                        </td>
                                                                                        <td class="value">

                                                                                            <asp:DropDownList runat="server" ID="ddlIsShopSet" class="j_select" Width="100" Enabled="false">

                                                                                                <asp:ListItem Text="未接收" Value="0"></asp:ListItem>
                                                                                                <asp:ListItem Text="已接收" Value="1"></asp:ListItem>
                                                                                                <asp:ListItem Text="拒绝" Value="2"></asp:ListItem>
                                                                                            </asp:DropDownList>

                                                                                            <label runat="server" id="lbshopnotice" style="color: red;"></label>

                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                </tbody>
                                                                            </table>
                                                                        </fieldset>
                                                                        <fieldset>
                                                                            <legend>收单点信息</legend>
                                                                            <table class="form-list" cellspacing="0">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td class="label" style="width: 80px;">
                                                                                            <label for="_accountwebsite_id">
                                                                                                订单编号 <span class="required">*</span></label>
                                                                                            <asp:HiddenField runat="server" ID="hidDataId" />
                                                                                            <asp:HiddenField runat="server" ID="hidUserId" />
                                                                                            <asp:HiddenField runat="server" ID="hidTogoId" />
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" Enabled="false" ID="tbOrderId" CanBeNull="必填" Width="200px"
                                                                                                class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                商家名称<span class="required"></span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" Enabled="false" ID="tbTogoName" Width="200px"
                                                                                                class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                联系人<span class="required"></span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbUserName" Width="200px"
                                                                                                class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                手机<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbTel" Width="200px" class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                地址<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox TextMode="MultiLine" Cols="2" Height="40px" runat="server" ID="tbAddress"
                                                                                                CanBeNull="必填" Width="200px" class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountpassword">
                                                                                                连单备注
                                                                                            </label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbMergeorderremark" class="required-entry input-text" Width="200px"
                                                                                                TextMode="MultiLine" Height="40px"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountpassword">
                                                                                                备注
                                                                                            </label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbremark" class="required-entry input-text" Width="200px"
                                                                                                TextMode="MultiLine" Height="40px"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountpassword">
                                                                                                其他备注
                                                                                            </label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbcardid" class="required-entry input-text" Width="200px"
                                                                                                TextMode="MultiLine" Height="40px"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                </tbody>
                                                                            </table>
                                                                        </fieldset>
                                                                        <fieldset>
                                                                            <legend>客户信息 </legend>
                                                                            <table class="form-list" cellspacing="0">
                                                                                <tbody>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                用户编号<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" Enabled="false" ID="tbUserId" CanBeNull="必填" Width="200px"
                                                                                                class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                用户名<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" Enabled="false" ReadOnly="true" ID="tbCustomerName" Width="200px"
                                                                                                class="required-entry input-text"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                </tbody>
                                                                            </table>
                                                                        </fieldset>
                                                                        <fieldset>
                                                                            <legend>订单信息</legend>
                                                                            <table class="form-list" cellspacing="0">
                                                                                <tbody>


                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountwebsite_id">
                                                                                                订单来源<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <asp:DropDownList ID="ddlsource" runat="server" Style="width: 120px;" Enabled="false"
                                                                                                CssClass="j_seclect">
                                                                                            </asp:DropDownList>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr id="tradminname" runat="server">
                                                                                        <td class="label">
                                                                                            <label for="_accountwebsite_id">
                                                                                                代客下单管理员<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbadminname" Enabled="false" class="required-entry input-text"
                                                                                                Width="200px"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                总金额<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbPrice" CanBeNull="必填" Width="60px" class="required-entry input-text"
                                                                                                Text=""></epc:TextBox>
                                                                                            元
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                配送距离<span class="required"></span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbcardpay" CanBeNull="必填" Width="60px"
                                                                                                class="required-entry input-text" Text=""></epc:TextBox>公里 
                                                                                            <input type="button" value="计算配送费" id="btgetfee" onclick="startcur()" class="subBtn" />

                                                                                           

                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                 
                                                                                  


                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                配送费<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbshopdiscountmoney" CanBeNull="必填" Width="60px" onblur="checkincome()"
                                                                                                class="required-entry input-text" Text=""></epc:TextBox>元
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                       <tr style=" display:none" id="base_box">
                                                                                        <td class="label">
                                                                                        </td>
                                                                                        <td class="value">
                                                                                          <span style="color:red;">提示：如果修改配送费请同步修改收入基数</span>
                                                                                           

                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>



                                                                                      <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                配送员收入<span class="required"></span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbDeliverGetSendFee" CanBeNull="必填" Width="60px" Enabled="false"
                                                                                                class="required-entry input-text" Text=""></epc:TextBox>元 
                                                                                            
                                                                                            

                                                                                            
                                                                                            
                                                                                            
                                                                                            
                                                                                            
                                                                                            <label style="display:inline;" >

                                                                                                 基数：<epc:TextBox runat="server" ID="tbdelivergetfee_base" CanBeNull="必填" Width="60px" 
                                                                                                class="required-entry input-text" Text=""></epc:TextBox>元 


                                                                                            </label>
                                                                                       

                                                                                            



                                                                                            <asp:Button ID="Button8" runat="server" CssClass="button_1" OnClick="feeupdate_Click" Visible="false"
                                                                                                Text="重新计算"></asp:Button>


                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>



                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                打包费<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbpakcage" Enabled="false" CanBeNull="必填" Width="60px"
                                                                                                class="required-entry input-text" Text=""></epc:TextBox>元
                                                                                   
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                代收金额 <span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbAdvance" CanBeNull="必填" Width="60px"
                                                                                                class="required-entry input-text" Text=""></epc:TextBox>元
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                佣金<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tbCommission" CanBeNull="必填" Width="60px"
                                                                                                class="required-entry input-text" Text=""></epc:TextBox>元
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>


                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                票/券</label>
                                                                                        </td>
                                                                                        <td class="value" style="width: 300px">
                                                                                            <asp:DropDownList runat="server" ID="ddlSystemUserId">
                                                                                                <asp:ListItem Text="否" Value="0"></asp:ListItem>
                                                                                                <asp:ListItem Text="是" Value="1"></asp:ListItem>

                                                                                            </asp:DropDownList>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountwebsite_id">
                                                                                                订单时间<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="tborderTime" Enabled="false" class="required-entry input-text"
                                                                                                Width="200px"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountwebsite_id">
                                                                                                支付方式<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <asp:DropDownList ID="ddlPaymode" runat="server" Style="width: 120px;" Enabled="false"
                                                                                                CssClass="j_seclect">

                                                                                                <asp:ListItem Value="4"> 货到付款</asp:ListItem>

                                                                                                <asp:ListItem Value="5">微信支付</asp:ListItem>
                                                                                            </asp:DropDownList>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                    <tr runat="server" id="paysttetr">
                                                                                        <td class="label">
                                                                                            <label for="_accountprefix">
                                                                                                支付状态</label>
                                                                                        </td>
                                                                                        <td class="value" style="width: 300px">
                                                                                            <asp:DropDownList runat="server" ID="ddlPaystate" Style="width: 80px;">
                                                                                                <asp:ListItem Text="未支付" Value="0"></asp:ListItem>
                                                                                                <asp:ListItem Text="支付成功" Value="1"></asp:ListItem>

                                                                                            </asp:DropDownList>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountwebsite_id">
                                                                                                支付金额<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="lblpaymoney" Enabled="false" class="required-entry input-text"
                                                                                                Width="120px"></epc:TextBox>元
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>
                                                                                    <tr>
                                                                                        <td class="label">
                                                                                            <label for="_accountwebsite_id">
                                                                                                送餐时间<span class="required">*</span></label>
                                                                                        </td>
                                                                                        <td class="value">
                                                                                            <epc:TextBox runat="server" ID="ddltime" Enabled="false" class="required-entry input-text"
                                                                                                Width="200px"></epc:TextBox>
                                                                                        </td>
                                                                                        <td>
                                                                                            <small>&nbsp;</small>
                                                                                        </td>
                                                                                    </tr>

                                                                                </tbody>
                                                                            </table>
                                                                        </fieldset>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </fieldset>
                                                    </div>
                                                </div>
                                                <div class="box-right">



                                                    <%----%>
                                                    <div class="entry-edit">
                                                        <div class="entry-edit-head">
                                                            <h4 class="icon-head fieldset-legend head-billing-address">订单中的餐品信息</h4>
                                                        </div>
                                                        <fieldset class="np">
                                                            <div class="order-address" id="">
                                                                <div class="grid">
                                                                    <div class="hor-scroll">



                                                                        <asp:GridView ID="rptsubItem" runat="server" CssClass="GridViewStyle" AutoGenerateColumns="False"
                                                                            OnRowCommand="GridView1_RowCommand" OnRowCancelingEdit="GridView_RowCancelingEdit"
                                                                            OnRowEditing="GridView_RowEditing" OnRowUpdating="GridView_RowUpdating">
                                                                            <Columns>
                                                                                <asp:TemplateField HeaderText="ID号" Visible="false">
                                                                                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                                                                                    <ItemTemplate>
                                                                                        <asp:Label runat="server" ID="lb_id" Text='<%# Eval("unid") %>'></asp:Label>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="商品">
                                                                                    <ItemStyle HorizontalAlign="Center" Width="45%" />
                                                                                    <ItemTemplate>
                                                                                        <%#Eval("FoodName")%>
                                                                                    </ItemTemplate>
                                                                                    <EditItemTemplate>
                                                                                        <epc:TextBox ID="tbFoodName" Text='<%#Eval("FoodName")%>' runat="server"></epc:TextBox>
                                                                                    </EditItemTemplate>
                                                                                </asp:TemplateField>
                                                                                <asp:TemplateField HeaderText="价格(元)">
                                                                                    <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                                                    <ItemTemplate>
                                                                                        <%#Eval("FoodPrice")%>
                                                                                    </ItemTemplate>
                                                                                    <EditItemTemplate>
                                                                                        <epc:TextBox ID="tbFoodPrice" Text='<%#Eval("FoodPrice")%>' Width="60" onkeypress="return only_num(event)" runat="server"></epc:TextBox>
                                                                                    </EditItemTemplate>
                                                                                </asp:TemplateField>


                                                                                <asp:TemplateField HeaderText="数量">
                                                                                    <ItemStyle HorizontalAlign="Center" Width="15%" />
                                                                                    <ItemTemplate>
                                                                                        <%#Eval("FCounts")%>
                                                                                    </ItemTemplate>
                                                                                    <EditItemTemplate>
                                                                                        <epc:TextBox ID="tbFCounts" Text='<%#Eval("FCounts")%>' Width="60" onkeypress="return only_num(event)" runat="server"></epc:TextBox>
                                                                                    </EditItemTemplate>
                                                                                </asp:TemplateField>


                                                                                <asp:CommandField HeaderText="编辑" ShowEditButton="True" />
                                                                                <asp:TemplateField HeaderText="操作">
                                                                                    <ItemStyle HorizontalAlign="Center" Width="7%" />
                                                                                    <ItemTemplate>
                                                                                        <asp:LinkButton CommandName="del" CommandArgument='<%# Eval("unid")%>' OnClientClick="return DelConfirm();"
                                                                                            runat="server" ID="delNew">删除</asp:LinkButton>
                                                                                    </ItemTemplate>
                                                                                </asp:TemplateField>
                                                                            </Columns>
                                                                        </asp:GridView>

                                                                        <table class="GridViewStyle adddatafoodtable" cellspacing="0" rules="all" border="1" id="rptsubItem2" style="border-collapse: collapse; margin-top: 20px;">

                                                                            <tr>
                                                                                <td align="center" style="width: 45%;">
                                                                                    <asp:TextBox runat="server" CssClass="j_text" ID="tbFoodName1" Text="" reg="\S" tip="请输入商品" placeholder="商品" Style="width: 95%" class="FormBase"></asp:TextBox>
                                                                                </td>
                                                                                <td align="center" style="width: 15%;">
                                                                                    <input name="tbFoodPrice1" type="text" runat="server" value="0" reg="^[-+]?\d+(\.\d+)?$" tip="价格格式错误,请输入数字" id="tbFoodPrice1" class="FormBase" onfocus="this.className='FormFocus';" onblur="this.className='FormBase';" onkeypress="return only_num(event)" size="30" style="width: 60px;" />
                                                                                </td>
                                                                                <td align="center" style="width: 15%;">
                                                                                    <input name="tbFCounts1" type="text" runat="server" value="0" reg="^\d+$" tip="数量格式错误,请输入整数" id="tbFCounts1" class="FormBase" onfocus="this.className='FormFocus';" onblur="this.className='FormBase';" onkeypress="return only_num(event)" size="30" style="width: 60px;" />
                                                                                </td>


                                                                                <td align="center" colspan="2">

                                                                                    <asp:Button ID="btaddfood" runat="server" CssClass="button_1" OnClick="addfood_Click" OnClientClick="return j_submitdata('adddatafoodtable')"
                                                                                        Text="添加商品"></asp:Button>

                                                                                </td>
                                                                            </tr>

                                                                        </table>


                                                                    </div>
                                                                </div>

                                                            </div>
                                                        </fieldset>
                                                    </div>

                                                    <div class="entry-edit">
                                                        <div class="entry-edit-head">
                                                            <h4 class="icon-head head-billing-address">损单记录</h4>
                                                        </div>
                                                        <fieldset class="np">
                                                            <div class="order-address" id="order-billing_address_fields">
                                                                <div class="content">
                                                                    <div class="hor-scroll">


                                                                        <table class="form-list" cellspacing="0">
                                                                            <tbody>

                                                                                <tr>
                                                                                    <td class="label">
                                                                                        <label for="_accountprefix">
                                                                                            损单选项<span class="required"></span></label>
                                                                                    </td>
                                                                                    <td class="value">

                                                                                        <asp:DropDownList runat="server" ID="ddlresponsibleparty" class="j_select">
                                                                                            <asp:ListItem Text="无" Value="-1"></asp:ListItem>
                                                                                            <asp:ListItem Text="商家问题" Value="0"></asp:ListItem>
                                                                                            <asp:ListItem Text="管理与调度问题" Value="10"></asp:ListItem>
                                                                                            <asp:ListItem Text="顾客问题" Value="20"></asp:ListItem>
                                                                                            <asp:ListItem Text="配送员问题" Value="30"></asp:ListItem>
                                                                                        </asp:DropDownList>



                                                                                    </td>
                                                                                    <td>
                                                                                        <small>&nbsp;</small>
                                                                                    </td>
                                                                                </tr>

                                                                                <tr>
                                                                                    <td class="label">
                                                                                        <label for="_accountpassword">
                                                                                            损单备注
                                                                                        </label>
                                                                                    </td>
                                                                                    <td class="value">
                                                                                        <epc:TextBox runat="server" ID="tbdamageRecordRemark" class="required-entry input-text" Width="200px"
                                                                                            TextMode="MultiLine" Height="40px"></epc:TextBox>
                                                                                    </td>
                                                                                    <td>
                                                                                        <small>&nbsp;</small>
                                                                                    </td>
                                                                                </tr>

                                                                                <tr>
                                                                                    <td class="label"></td>
                                                                                    <td class="value">

                                                                                        <asp:Button ID="btadd" runat="server" CssClass="button_1" OnClick="adddamage_Click"
                                                                                            Text="确认损单"></asp:Button>

                                                                                        <asp:Button ID="btdel" Style="display: none;" runat="server" CssClass="button_1" OnClick="delamage_Click"
                                                                                            Text="取消损单"></asp:Button>
                                                                                    </td>
                                                                                    <td>
                                                                                        <small>&nbsp;</small>
                                                                                    </td>
                                                                                </tr>

                                                                            </tbody>
                                                                        </table>


                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </fieldset>
                                                    </div>

                                                    <div class="entry-edit">
                                                        <div class="entry-edit-head">
                                                            <h4 class="icon-head fieldset-legend head-billing-address">用户位置</h4>
                                                        </div>
                                                        <fieldset class="np">
                                                            <div class="order-address" id="">
                                                                <div class="grid">
                                                                    <div class="hor-scroll" style="background-color: #fff;">
                                                                        <table class="form-list" cellspacing="0">
                                                                            <tbody>
                                                                                <tr>
                                                                                    <td style="line-height: 30px;">
                                                                                        <div>


                                                                                            <input runat="server" id="btcheckaddress" onclick="checkaddressandCloseWin()" type="button" style="float: right; margin-left: 10px;" css="button_1" value="复核" />


                                                                                            <asp:Button ID="Button3" runat="server" CssClass="button_1" OnClick="chagelocation_Click"
                                                                                                Text="更新用户位置"></asp:Button>

                                                                                            <div style="clear: both;"></div>


                                                                                        </div>
                                                                                        提示：拖动标准修改用户的位置

                                                                                         <div>
                                                                                             搜索地址:<epc:TextBox runat="server" ID="keyaddress"></epc:TextBox>
                                                                                             <input type="button" value="搜索" onclick="setPlace();">
                                                                                    </td>
                                                                                </tr>
                                                                            </tbody>
                                                                        </table>
                                                                        <div id="map_canvas" style="width: 100%; height: 400px;">
                                                                        </div>
                                                                    </div>
                                                                </div>
                                                            </div>
                                                        </fieldset>
                                                    </div>



                                                </div>

                                            </div>

                                            <div style="clear: both;"></div>

                                            <div class="entry-edit">
                                                <div class="entry-edit-head">
                                                    <h4 class="icon-head fieldset-legend head-billing-address">该用户最近订单</h4>
                                                </div>
                                                <fieldset class="np">
                                                    <div class="order-address" id="Div1">
                                                        <div class="grid">
                                                            <div class="grid">
                                                                <div class="hor-scroll">
                                                                    <table class="data" cellspacing="0">
                                                                        <colgroup>
                                                                            <col width="50" />
                                                                            <col width="60" />
                                                                            <col width="120" />
                                                                            <col width="160" />
                                                                            <col width="80" />
                                                                            <col width="40" />
                                                                            <col />
                                                                            <col width="90" />
                                                                            <col width="110" />
                                                                            <thead>
                                                                                <tr class="headings">
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#"><span class="sort-title">编号</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#"><span class="sort-title">用户名</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#"><span class="sort-title">商家</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#" name="created_at">
                                                                                            <!--sort-arrow-desc-->
                                                                                            <span class="sort-title">订单时间</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#"><span class="sort-title">收件人</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#"><span class="sort-title">金额</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#"><span class="sort-title">地址</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr"><a class="not-sort" href="#"><span class="sort-title">状态</span></a></span>
                                                                                    </th>
                                                                                    <th>
                                                                                        <span class="nobr">操作</span>
                                                                                    </th>
                                                                                </tr>
                                                                            </thead>
                                                                            <tbody class="grid_data">
                                                                                <asp:Repeater ID="rtpOrderlist" runat="server">
                                                                                    <ItemTemplate>
                                                                                        <tr class="pointer" title="">
                                                                                            <asp:HiddenField ID="hidDataId" runat="server" Value='<%# Eval("Unid")%>' />
                                                                                            <asp:HiddenField ID="hidOrderId" runat="server" Value='<%# Eval("Unid")%>' />
                                                                                            <td class="">
                                                                                                <a href='OrderDetail.aspx?id=<%# Eval("Unid")%>'>
                                                                                                    <%#Eval("orderid")%></a>
                                                                                            </td>
                                                                                            <td class="">
                                                                                                <%#Eval("CustomerName")%>
                                                                                            </td>
                                                                                            <td class="">
                                                                                                <%#Eval("TogoName") %>
                                                                                            </td>
                                                                                            <td class="">
                                                                                                <%#Eval("OrderDateTime").ToString()%>
                                                                                            </td>
                                                                                            <td class="">
                                                                                                <%#Eval("OrderRcver") %>
                                                                                            </td>
                                                                                            <td class="">
                                                                                                <%#Eval("OrderSums")%>
                                                                                            </td>
                                                                                            <td class="">
                                                                                                <%#Eval("AddressText")%>
                                                                                            </td>
                                                                                            <td class="">
                                                                                                <%#WebUtility.TurnOrderState(Eval("OrderStatus").ToString())%>
                                                                                            </td>
                                                                                            <td class=" last">
                                                                                                <a href='OrderDetail.aspx?id=<%#Eval("Unid") %>'>查看</a>
                                                                                            </td>
                                                                                        </tr>
                                                                                    </ItemTemplate>
                                                                                </asp:Repeater>
                                                                            </tbody>
                                                                        </colgroup>
                                                                    </table>
                                                                </div>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </fieldset>
                                            </div>
                                        </ContentTemplate>
                                    </asp:UpdatePanel>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!--foot start-->
            <uc2:Foot runat="server" ID="FootUC" />
            <!--foot end-->
        </div>
        <!--新增完成后弹出的窗口-->
        <div id="divShowContent" style="display: none;">
            您可以继续进行的操作<br />
            <ul>
                <li>
                    <button type="button" class="scalable " onclick="GotoBack()" style="">
                        <span>返回</span></button></li>
                <li>
                    <button type="button" class="scalable " onclick="GotoList()" style="">
                        <span>查看订单列表</span></button></li>
                <li><a href="../Shop/ShopList.aspx">进入商家列表</a></li>
            </ul>
        </div>

        <script language="javascript" type="text/javascript">
            function GotoBack() {
                history.go(-1);
            }

            function GotoList() {
                window.location.href = "OrderList.aspx";
            }
        </script>

        <div id="test" style="position: absolute; border-right: #a5a5a5 1px solid; padding-right: 10px; border-top: #a5a5a5 1px solid; padding-left: 15px; border-left: #a5a5a5 1px solid; width: 200px; border-bottom: #a5a5a5 1px solid; background-color: #ffffff; display: none"
            onmouseover="this.style.display='block'">
            <span>商家信息</span><span style="float: right;"><a href="#" onclick="Hide(this);return false;">关闭</a>
            </span>
            <hr />
            <br />
        </div>


        <div id="print_area" style="display: none;"></div>

        <div style="display: none">

            <div id="printdata">

                <div class="printinfo">
                    <asp:Repeater runat="server" ID="rptorder">
                        <ItemTemplate>
                            <div style="width: 210px;">
                                <h1>
                                    <%# Eval("togoname") %></h1>
                                <ul style="border-bottom: 1px dashed #666666; margin-bottom: 5px; padding-bottom: 5px;">
                                    <li><span>单号:</span><label><%# Eval("orderid") %></label></li>
                                    <li><span>订单时间:</span><label><%# Eval("OrderDateTime")%></label></li>
                                    <li><span>用户名:</span><label><%# Eval("CustomerName")%></label></li>
                                    <li><span>收货人:</span><label><%# Eval("OrderRcver")%></label></li>
                                    <li><span>送餐时间:</span><label><%# Eval("SendTime")%></label></li>
                                    <li><span>手机:</span><label><%# Eval("CallPhoneNo")%></label></li>
                                    <li><span>备注:</span><label><%# Eval("OrderAttach")%></label></li>
                                </ul>
                                <ul class="food">
                                    <li class="name">商品</li>
                                    <li class="num">数量</li>
                                    <li class="price">单价</li>
                                    <li class="price">小计</li>
                                </ul>
                                <div class="clear"></div>
                                <ul class="food">


                                    <asp:Repeater runat="server" ID="Repeater2" DataSource='<%# getproduct(Eval("orderid")) %>'>
                                        <ItemTemplate>
                                            <li class="name"><%# Eval("foodname")%></li>
                                            <li class="num"><%#Eval("FCounts")%></li>
                                            <li class="price"><%# Convert.ToDecimal( Eval("foodPrice")) %></li>
                                            <li class="price"><%# Convert.ToDecimal(Eval("foodPrice")) * Convert.ToInt32(Eval("FCounts"))%></li>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ul>
                                <div class="clear"></div>
                                <ul style="border-top: 1px dashed #666666; margin-top: 5px; padding-top: 5px;">
                                    <li>送餐费：<%# Eval("shopdiscountmoney")%>元</li>
                                    <li>支付方式：<%#  WebUtility.TurnPayModel(Eval("paymode").ToString()) %></li>
                                    <li>支付状态：<%# WebUtility.TurnPayState(Eval("paystate")) %></li>
                                    <li>收货地址：<%# Eval("AddressText")%></li>
                                </ul>
                            </div>
                        </ItemTemplate>
                    </asp:Repeater>
                </div>

            </div>

        </div>



    </form>
</body>
</html>

<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=fMnzyhYs0D1cBEl5iGMQ0Dlg"></script>

<script type="text/javascript">
    var gzoom = 20;
    var marker = null;
    var map = new BMap.Map("map_canvas"); // 创建地图实例
    map.enableScrollWheelZoom();
    var myGeo = new BMap.Geocoder();

    var hflocalinfo = eval("(" + $("#hflocalinfo").val() + ")");;

    var _lat = parseFloat(hflocalinfo.ulat);
    var _lng = parseFloat(hflocalinfo.ulng);
    var initpoint = new BMap.Point(_lng, _lat); // 创建点坐标

    $("#hfshoplat").val(hflocalinfo.slat);
    $("#hfshoplng").val(hflocalinfo.slng);

    $("#hidLat").val(_lat);
    $("#hidLng").val(_lng);




    var myIcon = new BMap.Icon("/Admin/Service/images/tack.gif", new BMap.Size(33, 33), { anchor: new BMap.Size(17, 0) });
    marker = new BMap.Marker(initpoint, { icon: myIcon });
    map.addOverlay(marker);
    marker.enableDragging();
    var mylabel = new BMap.Label("用户所在位置", { offset: new BMap.Size(8, -22) });
    mylabel.setStyle({ color: "blue", fontSize: "12px", padding: "2px 5px 2px 5px" });
    marker.setLabel(mylabel);

    addshopmarker();

    map.centerAndZoom(initpoint, gzoom);


    map.addControl(new BMap.NavigationControl());  //缩放工具


    function setLatLng(point) {
        document.getElementById("hidLat").value = point.lat;
        document.getElementById("hidLng").value = point.lng;
        return true;
    }

    function showme(lat, lng, dataid, address) {
        map.clearOverlays();
        var _lat = parseFloat(lat);
        var _lng = parseFloat(lng);
        var initpoint = new BMap.Point(_lng, _lat); // 创建点坐标
        marker = new BMap.Marker(initpoint, { icon: myIcon });
        map.addOverlay(marker);

        var mylabel = new BMap.Label(address, { offset: new BMap.Size(8, -22) });
        mylabel.setStyle({ color: "blue", fontSize: "12px", padding: "2px 5px 2px 5px" });
        marker.setLabel(mylabel);

        map.centerAndZoom(initpoint, gzoom);
    }



    EventWrapper.addListener(map, "click", function (e) {
        map.clearOverlays();
        initpoint = e.point;
        map.clearOverlays();

        marker = new BMap.Marker(initpoint, { icon: myIcon });
        map.addOverlay(marker);
        marker.enableDragging();
        var mylabel = new BMap.Label("用户所在位置", { offset: new BMap.Size(8, -22) });
        mylabel.setStyle({ color: "blue", fontSize: "12px", padding: "2px 5px 2px 5px" });
        marker.setLabel(mylabel);

        addshopmarker();
        setLatLng(initpoint);

        marker.addEventListener("dragend", function (e) {
            initpoint = e.point;
            map.clearOverlays();
            marker = new BMap.Marker(initpoint, { icon: myIcon });
            map.addOverlay(marker);
            marker.enableDragging();
            var mylabel = new BMap.Label("用户所在位置", { offset: new BMap.Size(8, -22) });
            mylabel.setStyle({ color: "blue", fontSize: "12px", padding: "2px 5px 2px 5px" });
            marker.setLabel(mylabel);

            addshopmarker();
            setLatLng(initpoint);
        });
    });

    marker.addEventListener("dragend", function (e) {
        initpoint = e.point;
        map.clearOverlays();
        marker = new BMap.Marker(initpoint, { icon: myIcon });
        map.addOverlay(marker);
        marker.enableDragging();
        var mylabel = new BMap.Label("用户所在位置", { offset: new BMap.Size(8, -22) });
        mylabel.setStyle({ color: "blue", fontSize: "12px", padding: "2px 5px 2px 5px" });
        marker.setLabel(mylabel);
        setLatLng(initpoint);
        addshopmarker();
    });

    function addshopmarker() {
        var _shoplat = parseFloat(hflocalinfo.slat);
        var _shoplng = parseFloat(hflocalinfo.slng);
        var shoppoint = new BMap.Point(_shoplng, _shoplat); // 创建点坐标
        var shopmarker = new BMap.Marker(shoppoint);
        map.addOverlay(shopmarker);
        var shoplabel = new BMap.Label("商家所在位置", { offset: new BMap.Size(8, -22) });
        shoplabel.setStyle({ color: "blue", fontSize: "12px", padding: "2px 5px 2px 5px" });
        shopmarker.setLabel(shoplabel);
    }


    function setPlace() {
        var hfcity = "全国";
        var address = document.getElementById("keyaddress").value.trim();
        var local = new BMap.LocalSearch(hfcity, {
            renderOptions: {
                map: map,
                autoViewport: true,
                selectFirstResult: false
            }
        });
        local.search(address);
    }

    ///复核，且关闭窗口
    function checkaddressandCloseWin() {
        var id = Request("id");
        Loader.show("#btcheckaddress");
        var para = "id=" + id + "&&method=checkaddressandCloseWin&admin=" + $("#hfadminname").val();
        jQuery.ajax(
        {
            type: "post",
            url: "/ajaxHandler.ashx",
            data: para,
            success: function (msg) {
                window.opener = null;;
                window.close();
            }
        })
    }


    function printorder() {
        //$('#print_area').html($('#printdata').html());
        //$("#print_area").printArea();


        $("#printdata").printArea();
    }


</script>
